package bb.lanxing.lib.devices.sgsettingentity.routebook;

import bb.lanxing.lib.devices.sgsettingentity.IDeletable;
import java.io.Serializable;
import java.util.List;
import kotlin.Metadata;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;

public final class RoutebookStruct implements IDeletable, Serializable {
    public static final Companion Companion = new Companion(null);
    private boolean checked;
    private String name;
    private final long size;
    private RoutebookStructState state;

    public RoutebookStruct() {
        this(null, 0L, null, false, 15, null);
    }

    public static /* synthetic */ RoutebookStruct copy(RoutebookStruct routebookStruct, String str, long j, RoutebookStructState routebookStructState, boolean z, int i, Object obj) {
        if ((i & 1) != 0) {
            str = routebookStruct.name;
        }
        if ((i & 2) != 0) {
            j = routebookStruct.size;
        }
        long j2 = j;
        if ((i & 4) != 0) {
            routebookStructState = routebookStruct.state;
        }
        RoutebookStructState routebookStructState2 = routebookStructState;
        if ((i & 8) != 0) {
            z = routebookStruct.checked;
        }
        return routebookStruct.copy(str, j2, routebookStructState2, z);
    }

    public final String component1() {
        return this.name;
    }

    public final long component2() {
        return this.size;
    }

    public final RoutebookStructState component3() {
        return this.state;
    }

    public final boolean component4() {
        return this.checked;
    }

    public final RoutebookStruct copy(String name, long j, RoutebookStructState routebookStructState, boolean z) {
        Intrinsics.checkNotNullParameter(name, "name");
        return new RoutebookStruct(name, j, routebookStructState, z);
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof RoutebookStruct)) {
            return false;
        }
        RoutebookStruct routebookStruct = (RoutebookStruct) obj;
        return Intrinsics.areEqual(this.name, routebookStruct.name) && this.size == routebookStruct.size && this.state == routebookStruct.state && this.checked == routebookStruct.checked;
    }

    private static int dataParser(long j) {
        return (int) (j ^ (j >>> 32));
    }

    public int hashCode() {
        int hashCode = ((this.name.hashCode() * 31) + dataParser(this.size)) * 31;
        RoutebookStructState routebookStructState = this.state;
        int hashCode2 = (hashCode + (routebookStructState == null ? 0 : routebookStructState.hashCode())) * 31;
        boolean z = this.checked;

        int i = z ? 1 : 0;
//        int i2 = z ? 1 : 0;
        return hashCode2 + i;
    }

    public String toString() {
        return "RoutebookStruct(name=" + this.name + ", size=" + this.size + ", state=" + this.state + ", checked=" + this.checked + ')';
    }

    public RoutebookStruct(String name, long j, RoutebookStructState routebookStructState, boolean z) {
        Intrinsics.checkNotNullParameter(name, "name");
        this.name = name;
        this.size = j;
        this.state = routebookStructState;
        this.checked = z;
    }

    public final String getName() {
        return this.name;
    }

    public final void setName(String str) {
        Intrinsics.checkNotNullParameter(str, "<set-?>");
        this.name = str;
    }

    public final long getSize() {
        return this.size;
    }

    public /* synthetic */ RoutebookStruct(String str, long j, RoutebookStructState routebookStructState, boolean z, int i, DefaultConstructorMarker defaultConstructorMarker) {
        this((i & 1) != 0 ? "" : str, (i & 2) != 0 ? 0L : j, (i & 4) != 0 ? RoutebookStructState.Synced : routebookStructState, (i & 8) != 0 ? false : z);
    }

    public final RoutebookStructState getState() {
        return this.state;
    }

    public final void setState(RoutebookStructState routebookStructState) {
        this.state = routebookStructState;
    }

    public final boolean getChecked() {
        return this.checked;
    }

    public final void setChecked(boolean z) {
        this.checked = z;
    }


    public static final class Companion {
        public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        private Companion() {
        }

        public final RoutebookStruct from(String s) {
//            Intrinsics.checkNotNullParameter(s, "s");
            try {
//                List split = StringsKt.split((CharSequence) s, new String[]{" "}, false, 0, 6, (Object) null);
                //TODO:hu
                List<String> split = StringsKt.split((CharSequence) s, null, 6);
                return new RoutebookStruct((String) split.get(0), Long.parseLong((String) split.get(1)), null, false, 12, null);
            } catch (Exception e) {
                e.printStackTrace();
                return new RoutebookStruct(null, 0L, null, false, 15, null);
            }
        }
    }

    @Override
    public String getFileNameForDelete() {
        return String.valueOf(this.name);
    }
}
